package com.service;

import com.dao.LeaveDao;
import com.pojo.Leave;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class LeaveService {
    @Resource
    private LeaveDao dao;

    /*用户提交请教申请*/
    public int addLeave(Leave leave){
        return dao.addLeave(leave);
    }
    /*查看全部请假信息*/
    public List<Leave> queryAll(int pageindex,int pagesize){
        return dao.queryAll(pageindex, pagesize);
    }
    public int countAll(String name){
        return dao.countAll(name);
    }
    /*通过请假*/
    public int successLeave(int id){
        return dao.successLeave(id);
    }
    /*拒绝请假*/
    public int errorLeave(int id){
        return dao.errorLeave(id);
    }
    /*根据name查询*/
    public List<Leave> queryByName(int pageindex,int pagesize,String name){
        return dao.queryByName(pageindex, pagesize, name);
    }
    public int countbystatus(){
        return dao.countbystatus();
    }
    public List<Leave> queryByBoth(int pageindex,int pagesize,String name,int status){
        return dao.queryByBoth(pageindex, pagesize, name, status);
    }
}
